package com.wdd.myplatform.providerservice.controller;


import com.wdd.commmon.providerservice.entity.Goods;
import com.wdd.myplatform.providerservice.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商品SPU数据表 前端控制器
 * </p>
 *
 * @author wdd
 * @since 2021-03-11
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;

    @GetMapping("/{goodsId}")
    public Goods getGoodsDetail(@PathVariable("goodsId") String goodsId){
        Goods goods = goodsService.getById(goodsId);
        return goods;
    }
}

